﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Web.Configuration;
using System.Web.Security;

public class EduLogger
{
    public EduLogger()
    {

    }
    public static void logActivity(string userName, string activity, string url)
    {

        string strConnString = WebConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;
        SqlConnection Connection = new SqlConnection(strConnString);

        string SqlQuery = "logActivity";
        SqlCommand cmd = new SqlCommand(SqlQuery, Connection);
        cmd.CommandType = CommandType.StoredProcedure;

        cmd.Parameters.AddWithValue("@UserName", userName);
        cmd.Parameters.AddWithValue("@Activity", activity);

        //if (recordPageUrl)
        //{
        cmd.Parameters.AddWithValue("@PageUrl", url);
        //}
        //else
        //{
        //    myCommand.Parameters.AddWithValue("@PageUrl", DBNull.Value);
        //}
        Connection.Open();
        cmd.ExecuteNonQuery();
        Connection.Close();

    }
    public int testfest(int x, int y)
    {
        return x + y;
    }
}